package com.tanhua.model.vo;


import com.tanhua.model.mongo.TestQuestion;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class TestQuestionVo {

    private String id;    //问题id
    private String question;   //问题名称
    private List<TestOptionVo> options;        //选项

    public static TestQuestionVo init(TestQuestion testQuestion, List<TestOptionVo> optionVos){
        TestQuestionVo vo = new TestQuestionVo();
        vo.setId(testQuestion.getId().toString());
        vo.setQuestion(testQuestion.getQuestion());
        vo.setOptions(optionVos);
        return vo;
    }
}
